home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / aclsdst.c next >
C/C++ Source or Header  |  1996-07-10  |  2KB  |  61 lines

  1.  /********************************************************
  2.  *                                                       *
  3.  *                      CLSDST                           *
  4.  *                                                       *
  5.  *  Function : This subroutine handle the VTAM style     *
  6.  *             CLSDST request.                           *
  7.  *  This function just sets appropriate values for the   *
  8.  *  RQB fields and then calls the "pattach" subroutine.  *
  9.  *  Here we use the following extern vars: - sem_no,     *
  10.  *  pparm.                                               *
  11.  *                                                       *
  12.  *  Input    :  RQB, th.ra.wa.hh.hscb - CID.             *
  13.  *  Output   :  Not applicable.                          *
  14.  *                                                       *  
  15.  * CopyRight 1995. Nicholas Poljakov all rights reserved.*
  16.  *                                                       *
  17.  ********************************************************/
  18. #include <include.h>
  19. #include <stdio.h>
  20. #include <malloc.h>
  21. #include <rpl.h>
  22. #include <state1.h>
  23. #include <string.h>
  24.  
  25. char *call_appl(void *);
  26.  
  27. int short sem_no;
  28.  
  29. clsdst(p_rpl)
  30. struct rpl *p_rpl;
  31. {
  32.     struct rqb *p_rqb;
  33.     char *p;
  34.  
  35.  
  36.     /* Allocate a RQB */
  37.     if ((p_rqb = calloc(1, sizeof(struct rqb))) == NULL) {
  38.         return (-1);
  39.     }
  40.  
  41.   /* Set RQB fields and call Pattach */
  42.  
  43.     p_rqb -> th.ra.stcb = APPL_CODE;
  44.     p_rqb -> th.ra.code = 0x80; /* RQB */
  45.     p_rqb -> th.ra.code = p_rqb -> th.ra.code & 0xfd; /* from = TOP */
  46.     p_rqb -> th.ra.wa.rqba.rsrlen = sem_no + ST_N;
  47.     if (p_rpl -> rsrv3 == 0) {
  48.         /* primary LU */
  49.         p_rqb -> th.ra.rparm.parm.parm1 = 3; /* CLSDST */
  50.     }
  51.     else
  52.             {
  53.                 /* secondary LU */
  54.                 p_rqb -> th.ra.rparm.parm.parm1 = 4; /* TERMSESS */
  55.             }
  56.     p_rqb -> th.ra.wa.hh.hscb = p_rpl -> arg; /*it's CID*/
  57.  
  58.     call_appl(p_rqb);
  59.         free(p_rqb);
  60. }
  61.